package com.itheima.utils;

import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import org.apache.poi.ss.usermodel.*;

import java.io.*;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ExportExcel {

public static void export(Map map,OutputStream out) throws IOException {

    TemplateExportParams params = new TemplateExportParams(
            "C:\\Users\\Sun\\Desktop\\模板.xlsx");

    Workbook workbook = ExcelExportUtil.exportExcel(params, map);
    OutputStream outputStream = new BufferedOutputStream(out);
    workbook.write(outputStream);

}
}
